<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>需求报价管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			// 选择车型时，自动带出超公里数收费情况
			$('#cargotype').change(function(){
				$('#cargotype_seat').val($(this).find('option:selected').attr('data-seats'))
			});
			$('#cargotype').change(); // 默认时候这超公里数收费金额
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
 		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/rentproduct/demandsPrice/">需求报价列表</a></li>
		<li class="active"><a href="${ctx}/rentproduct/demandsPrice/allform?demandid=${tDemands.demandid}">需求报价反馈</a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="tDemands" action="${ctx}/rentproduct/demandsPrice/save" method="post" class="form-horizontal">
		<form:hidden path="demandid"/>
		<sys:message content="${message}"/>
		<div class="control-group">
			<label class="control-label">出发城市：</label>
			<div class="controls">
				<input type="text" class="span4" value="${tDemands.departcity.sitename }" readonly/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">到达城市：</label>
			<div class="controls">
				<input type="text" class="span4" value="${tDemands.destcity.sitename }" readonly/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">行程描述：</label>
			<div class="controls">
				<textarea rows="4" class="span4" readonly>${tDemands.modeldesc }</textarea>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">选择车型：</label>
			<div class="controls">
				<input type="text" class="span4" value="${tDemands.cartype.typename }" readonly/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">包车数量：</label>
			<div class="controls">
				<input type="text" class="span4" value="${tDemands.vehiclenum }" readonly/>
				<span class="help-inline">辆</span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">用车时间：</label>
			<div class="controls">
				<input type="text" readonly="readonly" class="span4"
					value="<fmt:formatDate value="${tDemands.fromdate}" pattern="yyyy-MM-dd HH:mm"/>"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">包车天数：</label>
			<div class="controls">
				<input type="text" class="span4" value="${tDemands.rentdays }" readonly/>
				<span class="help-inline">天</span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">联系人：</label>
			<div class="controls">
				<input type="text" class="span4" value="${tDemands.contactor }" readonly/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">联系电话：</label>
			<div class="controls">	
				<input type="text" class="span4" value="${tDemands.contactphone }" readonly/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">备注：</label>
			<div class="controls">
				<textarea rows="4" class="span4" readonly>${tDemands.remarks }</textarea>
			</div>
		</div>
		<c:if test="${not empty reactList }">
			<div style="height:auto;margin:0;padding:0;overflow:hidden;border-width:1px 1px 1px 1px;border-style:solid;border-color:#daf3ff">
			<table style="width:100%;">
								<tr style="background:#daf3ff">
									<th style="text-align:center;width:15%">名称</th>
									<th style="text-align:center;width:15%">总价</th>
									<th style="text-align:center;width:30%">车辆备注</th>
									<th style="text-align:center;width:20%">响应时间</th>
								</tr>
								<c:forEach items="${reactList }" var="react">
									<tr>
										<td style="text-align:center;">${react.office.abbr }</td>
										<td style="text-align:center;">${react.price }</td>
										<td style="text-align:center;">${react.remarks }</td>
										<td style="text-align:center;"><fmt:formatDate value="${react.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
										</tr>
								</c:forEach>
							</table>
						</div>
					</c:if>
		<div class="form-actions">
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>